﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.IO;
using System.Web.Script.Serialization;

namespace STAR.Spring.Framework.Module
{
    /// <summary>
    /// 单请求参数
    /// </summary>
    public class RequestJsonParmInfo
    {
        public string RequestName { get; set; }

        public string[] Parms { get; set; }

        public bool IsParmRight { get; set; }

        public RequestJsonParmInfo()
        {
            IsParmRight = false;

            HttpRequest Request = HttpContext.Current.Request;
            StreamReader sr = new StreamReader(Request.InputStream);
            string jsonString = sr.ReadToEnd();
            try
            {
                RequestJsonParmInfo obj = new JavaScriptSerializer().Deserialize<RequestJsonParmInfo>(jsonString);
                if (obj != null)
                {
                    this.Parms = obj.Parms;
                    this.RequestName = obj.RequestName;
                    IsParmRight = true;
                }
            }
            catch
            {

            }
        }
    }
}
